home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / libblas / blas.z / blas
Encoding:
Text File  |  1998-10-30  |  12.8 KB  |  331 lines

  1.  
  2.  
  3.  
  4. BBBBLLLLAAAASSSS((((3333FFFF))))                                                              BBBBLLLLAAAASSSS((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      BLAS - Basic Linear Algebra Subprograms
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      BLAS is a library of routines that perform basic operations involving
  13.      matrices and vectors. They were designed as a way of achieving efficiency
  14.      in the solution of linear algebra problems. The BLAS, as they are now
  15.      commonly called, have been very successful and have been used in a wide
  16.      range of software, including LINPACK, LAPACK and many of the algorithms
  17.      published by the ACM Transactions on Mathematical Software. They are an
  18.      aid to clarity, portability, modularity and maintenance of software, and
  19.      have become the de facto standard for elementary vector and matrix
  20.      operations.
  21.  
  22.      The BLAS promote modularity by identifying frequently occurring
  23.      operations of linear algebra and by specifying a standard interface to
  24.      these operations.  Efficiency is achieved through optimization within the
  25.      BLAS without altering the higher-level code that has referenced them.
  26.  
  27.      There are three levels of BLAS. The original set of BLAS, commonly
  28.      referred as the Level 1 BLAS, perform low-level operations such as dot-
  29.      product and the adding of a multiple of one vector to another. Typically
  30.      these operations involve O(N) floating point operations and O(N) data
  31.      items moved (loaded or stored), where N is the length of the vectors. The
  32.      Level 1 BLAS permit efficient implementation on scalar machines, but the
  33.      ratio of floating-point operations to data movement is too low to achieve
  34.      effective use of most vector or parallel hardware.
  35.  
  36.      The Level 2 BLAS perform Matrix-Vector operations that occur frequently
  37.      in the implementation of mant of the most common linear algebra
  38.      algorithms.  They involve O(N^2) floating point operations. Algorithms
  39.      that use Level 2 BLAS can be very efficient on vector computers, but are
  40.      not well suited to computers with a hierarchy of memory (such as cache
  41.      memory).
  42.  
  43.      The Level 3 BLAS are targeted at matrix-matrix operations. These
  44.      operations generally involve O(N^3) floating point operations, while only
  45.      creating O(N^2) data movement. These operations permit efficient reuse of
  46.      data that resides in cache and create what is often called the surface-
  47.      to-volumne effect for the ratio of computations to data movement. In
  48.      addition, matrices can be partitioned into blocks, and operations on
  49.      distinct blocks can be performed in parallel, and within the operations
  50.      on each block, scalar or vector operations may be performed in parallel.
  51.  
  52.      BLAS2 and BLAS3 modules have been optimized and parallelized to take
  53.      advantage of SGI's RISC parallel architecture. The best performances are
  54.      achieved for BLAS3 routines (e.g. DGEMM), where "outer-loop" unrolling +
  55.      "blocking" techniques were applied to take advantage of the memory cache.
  56.      The performance of BLAS2 routines (e.g. DGEMV) is sensitive to the size
  57.      of the problem, for large sizes the high rate of cache miss slows down
  58.      the algorithms.
  59.      LAPACK algorithms use preferably BLAS3 modules and are the most
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. BBBBLLLLAAAASSSS((((3333FFFF))))                                                              BBBBLLLLAAAASSSS((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      efficient.  LINPACK uses only BLAS1 modules and therefore is less
  75.      efficient than LAPACK.
  76.  
  77.      To link with "libblas", it is advised to use "f77" to load all the
  78.      Fortran Libraries required, otherwise include -lftn in your link line.
  79.      For R8000 and R10000 based machines, you should use the mips4 version.
  80.      This is accomplished by using ----mmmmiiiippppssss4444 when linking:
  81.           ffff77777777 ----mmmmiiiippppssss4444 -o foobar.out foo.o bar.o ----llllbbbbllllaaaassss
  82.      To use the parallelized version, use
  83.           ffff77777777 ----mmmmiiiippppssss4444 ----mmmmpppp -o foobar.out foo.o bar.o ----llllbbbbllllaaaassss____mmmmpppp
  84.  
  85. SSSSUUUUMMMMMMMMAAAARRRRYYYY
  86.      BBBBLLLLAAAASSSS LLLLeeeevvvveeeellll 1111::::
  87.          .....function......      ....prefix,suffix.....  rootname
  88.          dot product              s-  d- c-u c-c z-u z-c  -dot-
  89.          y = a*x + y              s-  d-     c-      z-   -axpy
  90.          setup Givens rotation    s-  d-                  -rotg
  91.          apply Givens rotation    s-  d-     cs-     zd-  -rot
  92.          copy x into y            s-  d-     c-      z-   -copy
  93.          swap x and y             s-  d-     c-      z-   -swap
  94.          Euclidean norm           s-  d-     sc-     dz-  -nrm2
  95.          sum of absolute values   s-  d-     sc-     dz-  -asum
  96.          x = a*x                  s-  d- cs- c-  zd- z-   -scal
  97.          index of max abs value  is- id-     ic-     iz-  -amax
  98.  
  99.  
  100.      BBBBLLLLAAAASSSS LLLLeeeevvvveeeellll 2222::::
  101.         MV Matrix vector multiply
  102.         R  Rank one update to a matrix
  103.         R2 Rank two update to a matrix
  104.         SV Solving certain triangular matrix problems.
  105.  
  106.      single precision Level 2 BLAS     |     Double precision Level 2 BLAS
  107.      -----------------------------------------------------------------------
  108.              MV   R    R2  SV          |             MV   R    R2  SV
  109.      SGE     x    x                    |     DGE     x    x
  110.      SGB     x                         |     DGB     x
  111.      SSP     x    x    x               |     DSP     x    x    x
  112.      SSY     x    x    x               |     DSY     x    x    x
  113.      SSB     x                         |     DSB     x
  114.      STR     x              x          |     DTR     x              x
  115.      STB     x              x          |     DTB     x              x
  116.      STP     x              x          |     DTP     x              x
  117.  
  118.      complex  Level 2 BLAS             | Double precision complex Level 2 BLAS
  119.      -----------------------------------------------------------------------
  120.              MV   R     RC   RU  R2  SV|          MV   R     RC   RU  R2  SV
  121.      CGE     x          x    x         |  ZGE     x          x    x
  122.      CGB     x                         |  ZGB     x
  123.      CHE     x    x              x     |  ZHE     x    x              x
  124.      CHP     x    x              x     |  ZHP     x    x              x
  125.      CHB     x                         |  ZHB     x
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. BBBBLLLLAAAASSSS((((3333FFFF))))                                                              BBBBLLLLAAAASSSS((((3333FFFF))))
  137.  
  138.  
  139.  
  140.      CTR     x                       x |  ZTR     x                       x
  141.      CTB     x                       x |  ZTB     x                       x
  142.      CTP     x                       x |  ZTP     x                       x
  143.  
  144.      BBBBLLLLAAAASSSS LLLLeeeevvvveeeellll 3333::::
  145.         MM  Matrix matrix multiply
  146.         RK  Rank-k update to a matrix
  147.         R2K Rank-2k update to a matrix
  148.         SM Solving triangular matrix with many right-hand-sides.
  149.  
  150.      single precision Level 3 BLAS     |     Double precision Level 3 BLAS
  151.      -----------------------------------------------------------------------
  152.              MM   RK   R2K SM          |             MM   RK   R2K SM
  153.      SGE     x                         |     DGE     x
  154.      SSY     x    x    x               |     DSY     x    x    x
  155.      STR     x              x          |     DTR     x              x
  156.  
  157.      complex  Level 3 BLAS             | Double precision complex Level 3 BLAS
  158.      -----------------------------------------------------------------------
  159.              MM   RK   R2K SM          |             MM   RK   R2K SM
  160.      CGE     x                         |     ZGE     x
  161.      CSY     x    x    x               |     ZSY     x    x    x
  162.      CHE     x    x    x               |     ZHE     x    x    x
  163.      CTR     x              x          |     ZTR     x              x
  164.  
  165. CCCC IIIINNNNTTTTEEEERRRRFFFFAAAACCCCEEEE
  166.      There is a C interface for the BLAS library. The implementation is based
  167.      on the proposed specification for BLAS routines in C [1].
  168.  
  169.      The argument lists follow closely the equivalent Fortran ones. The main
  170.      changes being that enumeration types are used instead of character types
  171.      for option specification, and two dimensional arrays are stored in one
  172.      dimensional C arrays in an analogous fashion as a Fortran array (column
  173.      major). Therefore, a matrix A would be stored as:
  174.  
  175.            double (*a)[lda*n];
  176.         /*                                                         */
  177.         /*          aaaa is a pointer to an array of size ttttddddaaaa****nnnn       */
  178.         /*                                                         */
  179.  
  180.      where  element  A(i+1,j)  of matrix A  is stored  immediately  after the
  181.      element  A(i,j), while  A(i,j+1) is lda  elements apart from  A(i,j). The
  182.      element A(i,j) of the matrix can be accessed directly by reference to  a[
  183.      (j-1)*lda + (i-1) ].
  184.  
  185.      The names of the C versions of the BLAS are the same as the Fortran
  186.      versions since the compiler puts the Fortran names in upper case and adds
  187.      an underscore after the name.
  188.  
  189.      The argument lists use the following data types:
  190.  
  191.              Integer:        an integer data type of 32 bits.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. BBBBLLLLAAAASSSS((((3333FFFF))))                                                              BBBBLLLLAAAASSSS((((3333FFFF))))
  203.  
  204.  
  205.  
  206.                float:        the regular single precision floating-point type.
  207.               double:        the regular double precision floating-point type.
  208.              Complex:        a single precision complex type.
  209.              Zomplex:        a double precision complex type.
  210.  
  211.      plus the enumeration types given by
  212.  
  213.        typedef enum { NoTranspose, Transpose, ConjugateTranspose }
  214.                     MatrixTranspose;
  215.  
  216.        typedef enum { UpperTriangle, LowerTriangle }
  217.                     MatrixTriangle;
  218.  
  219.        typedef enum { UnitTriangular, NotUnitTriangular }
  220.                     MatrixUnitTriangular;
  221.  
  222.        typedef enum { LeftSide, RightSide }
  223.                     OperationSide;
  224.  
  225.      The complex data types are stored in cartesian form, i.e., as real and
  226.      imaginary parts. For example
  227.  
  228.        typedef struct {  float real;
  229.                          float imag;
  230.                                      } Complex;
  231.  
  232.        typedef struct { double real;
  233.                         double imag;
  234.                                      } Zomplex;
  235.  
  236.      The operations performed by the C BLAS are identical to those performed
  237.      by the corresponding Fortran BLAS, as specified in [2], [3] and [4].
  238.  
  239.      To use the C BLAS, link with "libblas". It is advised to use "f77" to
  240.      load all the Fortran Libraries required:
  241.           ffff77777777 -o foobar.out foo.o bar.o ----llllbbbbllllaaaassss
  242.  
  243. FFFFIIIILLLLEEEESSSS
  244.      /usr/lib/libblas.a
  245.      /usr/lib/libblas_mp.a
  246.      /usr/include/cblas.h
  247.  
  248. OOOORRRRIIIIGGGGIIIINNNN
  249.      The original Fortran source code comes from netlib.
  250.  
  251. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  252.      S.P. Datardina, J.J. Du Croz, S.J. Hammarling and M.W. Pont, "A Proposed
  253.      Specification of BLAS Routines in C", NAG Technical Report TR6/90.
  254.  
  255.      C Lawson, R. Hanson, D. Kincaid, and F. Krough, "Basic Linear Algebra
  256.      Subprograms for Fortran usage ", ACM Trans. on Math. Soft. 5(1979)
  257.      308-325
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. BBBBLLLLAAAASSSS((((3333FFFF))))                                                              BBBBLLLLAAAASSSS((((3333FFFF))))
  269.  
  270.  
  271.  
  272.      J.Dongarra, J.DuCroz, S.Hammarling, and R.Hanson, "An extended set of
  273.      Fortran Basic Linear Algebra Subprograms", ACM Trans. on Math. Soft. 14,
  274.      1(1988) 1-32
  275.  
  276.      J.Dongarra, J.DuCroz, I.Duff,and S.Hammarling, "An set of level 3 Basic
  277.      Algebra Subprograms", ACM Trans on Math Soft( Dec 1989)
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.